home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / DJBSN116.ARJ / FAQ < prev    next >
Text File  |  1992-04-13  |  7KB  |  128 lines

  1.  
  2. Q: When I run "gcc e:\proj\prog.c" it says "undefined escape sequence \p"?
  3. A: Gcc is a *unix* compiler - you must use *unix* slashes (e:/proj/prog.c).
  4.    Environment variables (like GCCINC) may, however, use either, as they
  5.    are converted.
  6.  
  7. Q: I type "GCC PROG.C" and ld complains about PROG.C not being an object.
  8. Q: I type "gcc prog.cxx" to compile a C++ program, and ld complains.
  9. A: Gcc is *not* case insensitive like DOS is, and it uses the file's
  10.    extension to determine how to compile a file.  Valid extensions are:
  11.      .cc = C++ source (passed through cpp)
  12.      .c = C source that must be passed through cpp first
  13.      .i = raw C source (no cpp pass)
  14.      .S = assembler that must be passed through cpp first
  15.      .s = raw assembler source (no cpp pass)
  16.    any other file is passed to the linker
  17.  
  18. Q: I compile my program, but can't run the output file.
  19. A: DOS doesn't know how to run unix-style a.out files.  That's what the
  20.    extender is for.  To run an a.out file called myprog, type
  21.      "go32 myprog . . ."
  22.  
  23. Q: Gcc doesn't recognize // as a comment in my C programs.
  24. A: That's because // isn't a comment in C.  If you want to compile C++,
  25.    then write C++ programs.  Gcc is really two compilers in one, not
  26.    one compiler that compiles both C and C++.  That's why you get
  27.    cc1 and cc1plus.
  28.  
  29. Q: I'm reading in data files, but the data gets corrupted.
  30. A: The default file type is DOS text, even for read() and write().  You must
  31.    tell the system that a file is binary through the "b" flag in fopen(),
  32.    or O_BINARY in open().
  33.  
  34. Q: I get "fatal signal 2" when I run gcc.
  35. A: When gcc reports a "signal", it really means that an error occurred
  36.    trying to run the given program.  The "signal" number is the DOS error
  37.    code, and 2 means "file not found".  Check the COMPILER_PATH environment
  38.    variable and make sure it points to the directory with cpp.exe,
  39.    cc1.exe, etc.
  40.  
  41. Q: The binaries I get with the distribution are .exe files, but gcc creates
  42.    a.out files.  I rename the a.out's to .EXE's, but they still don't work.
  43. A: To get an .EXE from an a.out, you must *prepend* either go32.exe,
  44.    debug32.exe, or stub.exe to the file.  A program called "aout2exe"
  45.    is provided to do this.  Just run "aout2exe myprog".
  46.  
  47. Q: What is stub.exe?
  48. A: Stub.exe simply calles go32.exe, and passes it information it needs to
  49.    run the a.out file attached to it.  Stub is much smaller than go32, so
  50.    less disk space is used.  Also, if you change go32, you don't have to
  51.    change stub, and all the stub-ized programs will use the new go32
  52.    automatically.
  53.  
  54. Q: I want to change cc1.  How do I do this?
  55. A: First, get the GNU sources from FSF.  They're usually available at
  56.    prep.ai.mit.edu in /u/emacs, if not elsewhere.  Use djtarx to un-tar
  57.    them, as djtarx knows how to handle unix file names that aren't valid
  58.    DOS file names.  Look in the "diffs" sources to see what to change the
  59.    names to when they conflict.  Next, apply the "diffs" (if any) over the
  60.    GNU sources (making sure you have the right version of GNU - see the
  61.    versions file).  For gcc 2.0 and above, you must run "configure go32"
  62.    to prepare the sources for a native go32 compiler before building.
  63.    For all other programs, just run make.  Note that the makefiles
  64.    are tuned for ndmake, since it knows how to make response files.
  65.    Specific instructions are documented in the diffs directory.
  66.  
  67. Q: I don't have an 80387.  How do I compile floating point programs?
  68. A: Add "emu c:\djgpp\emu387\emu387" to the GO32 environment variable
  69.    (see go32 section in readme).  This tells go32 to use the given file
  70.    as an 80387 emulator.  If you don't load this emulator, and you try
  71.    to run floating point without a 387, you will get an error.
  72.  
  73. Q: I installed an 80387 emulator in my AUTOEXEC, but it still doesn't
  74.    work.  Why?
  75. A: The CPU is running in *protected* mode, not real mode, and the information
  76.    needed to emulate the 80387 is different.  Not to mention that the
  77.    exceptions never get to the real-mode handler.  You must use the emu387
  78.    emulator, which is designed for go32.
  79.  
  80. Q: I can't run a.out programs under Windows.
  81. A: Nope, you can't.  Go32 only supports VCPI, and Windows provides
  82.    DPMI 0.9, which isn't enough for Go32 to work correctly.
  83.  
  84. Q: Can I run this on my 286?  It has protected mode also...
  85. A: True, but the 286 isn't a 32-bit processor.  A 386 really is required.
  86.  
  87. Q: Can I use gcc on my 512K machine?
  88. A: Yes, but the disk better have at least 4Mb of free space for paging.
  89.    Go32 will use all available extended memory (up to 128M) and up to
  90.    128M of disk space, for a grand total of 256M of virtual memory for
  91.    your application.  Try a malloc(50*1024*1024) some day.
  92.  
  93. Q: Why do my compiles are running VERY SLOW, even though I use a ramdisk
  94.    for swap and a disk cache?
  95. A: Gcc requires at least 1Mb of virtual memory to run, usually close to 1.5M.
  96.    If there isn't this much real memory available, it starts paging to disk.
  97.    It's good to leave about 1M of extended (not expanded) memory available
  98.    for go32 to run programs with.  When it needs to page a lot, you spend
  99.    most of your time paging and little time actually running.  Note that
  100.    if you are running with a VCPI server, like QEMM or 386MAX, then go32
  101.    will use *expanded* memory for it's physical memory needs, not
  102.    extended.
  103.  
  104. Q: How much memory is available when I use the system() call?
  105. A: Everything but what go32 is loaded with.  The program is completely
  106.    paged out to memory (including the page tables themselves) before
  107.    the second program is executed.  Currently, this is about 100K
  108.    less than was available before go32 was executed.
  109.  
  110. Q: Go32 complains that the CPU must be in V86 mode to run.
  111. A: When the CPU is in V86 mode, the V86 manager must provide VCPI
  112.    services for go32.  Since VCPI is an extension to EMS, disabling EMS
  113.    will disable VCPI, and prevent go32 from running.  For emm386.sys, this
  114.    means that you can't use the "noems" switch. 
  115.  
  116. Q: How do globbing and response files work?
  117.  
  118. A: A response file is a file that contains stuff that goes on the command
  119.    line, but is too big for DOS.  The name of the file is given as "@file"
  120.    to any a.out program, and go32 reads the file for command line
  121.    information.  It uses single and double quotes to group parameters, and
  122.    backslashes to escape quotes, spaces, tabs, newlines, and backslashes. 
  123.    Parameters containing wildcards are expanded if they can be, else they
  124.    are unmodified.  Surrounding a parameter in single quotes will prevent
  125.    wildcards from being expanded.  This is similar to unix.  Note that
  126.    backslashes are not special if they are not in front of a quote,
  127.    whitespace, or backslash. 
  128.